
export const data = [
    {
        name: '高德地图初始化',
        component: () => <></>,
        html: `declare let AMap: any
export const InitMap = (id = 'container') => {
    let map: any = ''
    map = new AMap.Map(id, {
        zoom: 13,
        rotateEnable: true,
        pitchEnable: true,
        pitch: 0,
        defaultCursor: 'Pointer',
        showBuildingBlock: false,
        buildingAnimation: true,
        expandZoomRange: true,
        zooms: [0, 20],
        resizeEnable: true,
        features: ['point', 'road', 'bg'],
        viewMode: '3D',
        cursor: 'move'
    })
    map.setFitView()
    return map
}`
    }, {
        name: '高德地图换肤',
        component: () => <></>,
        html: `export const setMapStyle = (map:any, value:string) => {
    const myStyle = 'amap://styles/' + value
    map.setMapStyle(myStyle)
}
`
    },{
        name: '高德地图设置中心点',
        component: () => <></>,
        html: `export const setZoomCentrer = (map, index, position) => {
  map.setZoomAndCenter(index, position)
}
`
    }
]
